<template>
  <el-row class="tac">
    <el-col :span="40">
      <h5 class="mb-2">Default colors</h5>
      <el-menu default-active="2" class="el-menu-vertical-demo">
        <el-sub-menu index="1">
          <template #title>
            <el-icon>
              <location />
            </el-icon>
            <span>用户管理</span>
          </template>
          <el-menu-item index="1-1" @click="goToUserQuery">用户查询</el-menu-item>
          <el-menu-item index="1-2" @click="goToUserAdd">用户添加</el-menu-item>
        </el-sub-menu>
        <el-sub-menu index="2">
          <template #title>
            <el-icon>
              <location />
            </el-icon>
            <span>订单管理</span>
          </template>
          <el-menu-item index="2-1" @click="goToOrsersQuery">订单查询</el-menu-item>
          <el-menu-item index="2-2" @click="goToShoppingCart">购物车查询</el-menu-item>
        </el-sub-menu>
        <!-- <el-menu-item index="2">
          <el-icon><icon-menu /></el-icon>
          <span>Navigator Two</span>
        </el-menu-item>Test
        <el-menu-item index="3" disabled>
          <el-icon><document /></el-icon>
          <span>Navigator Three</span>
        </el-menu-item>
        <el-menu-item index="4">
          <el-icon><setting /></el-icon>
          <span>Navigator Four</span>
        </el-menu-item> -->
      </el-menu>
    </el-col>
  </el-row>
</template>


<script lang="ts" setup>
import { useRouter } from "vue-router";
import {
  Document,
  Menu as IconMenu,
  Location,
  Setting,
} from '@element-plus/icons-vue'

const router = useRouter();

function goToUserQuery() {
  router.push("/userquery");
}

function goToUserAdd() {
  router.push("/useradd");
}

function goToOrsersQuery() {
  router.push("/ordersquery");
}

function goToShoppingCart() {
  router.push("/shoppingcart");
}
</script>